﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdComponent.aspx.cs" Inherits="VelocityCMS.Components.VelocityComponents.Views.AdComponent" %>

<form action="<%= Url.Action("PageSave/TestPage1")%>" method="post">
<div class="ad">
    <asp:Literal ID="AdContent" runat="server" />
    <%=Html.Hidden("ComponentName", "VelocityCMS.Components.VelocityComponents.Views.AdComponent")%>
    <h2>Content Groups</h2>
    <% 
       foreach (var contentGroup in (IEnumerable<VelocityCMS.Models.ContentGroup>)(ViewData.ContentData))
       { 
    %>
    
            
    <h3>This is the start of a group Group ID:<%=contentGroup.ID %></h3>
    <div>GroupType:<%=contentGroup.GroupType%></div>
    <div>Author:<%=contentGroup.Author%></div>
    <div>ParentID:<%=contentGroup.ParentID%></div>
    
        <% 
        foreach (var contentElement in (IEnumerable<VelocityCMS.Models.ContentElement>)(contentGroup.ContentElements))
        { 
        %>
        <p>
            <strong>ID:<%=contentElement.ID%></strong>
            <div>GroupID:<%=contentElement.GroupID%></div>
            <div>ContentDate:<%=contentElement.ContentDate%></div>
            <div>ContentType:<%=contentElement.ContentType%></div>    
            <div>ContentData:<%=Html.TextArea("ContentData_" + contentElement.ID, contentElement.ContentData)%></div>
            
        </p>
        <%  
        } 
        %>
        
    <%  
    }  
    %>
    <input type="submit" value="Save" />
</div>
</form>